# 猜数字
import random
a = random.randint(1, 100)
print(a)
i = 0
# 猜5次
while i < 5:
    answer = int(input("请输入要猜的数字: "))
    # 猜对了，退出循环
    if answer == a:
        print('猜对了')
        break
    elif answer > a:
        print('猜大了')
    else:
        print("猜小了")
    i += 1
# 5次都没猜对
else:
    print("正确答案：", a)